using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace dpatoolkit
{
	/// <summary>
	/// Summary description for ExceptionForm.
	/// </summary>
	public class ExceptionForm : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Button clipBoardButton;
		private System.Windows.Forms.TextBox textBox;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public ExceptionForm(Exception exp)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			this.textBox.Text=exp.ToString();
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.textBox = new System.Windows.Forms.TextBox();
			this.clipBoardButton = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// textBox
			// 
			this.textBox.Location = new System.Drawing.Point(24, 16);
			this.textBox.Multiline = true;
			this.textBox.Name = "textBox";
			this.textBox.ReadOnly = true;
			this.textBox.Size = new System.Drawing.Size(496, 192);
			this.textBox.TabIndex = 0;
			this.textBox.Text = "";
			// 
			// clipBoardButton
			// 
			this.clipBoardButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.clipBoardButton.Location = new System.Drawing.Point(264, 232);
			this.clipBoardButton.Name = "clipBoardButton";
			this.clipBoardButton.Size = new System.Drawing.Size(112, 23);
			this.clipBoardButton.TabIndex = 1;
			this.clipBoardButton.Text = "Copy To ClipBoard";
			this.clipBoardButton.Click += new System.EventHandler(this.clipBoardButton_Click);
			// 
			// ExceptionForm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(544, 266);
			this.Controls.Add(this.clipBoardButton);
			this.Controls.Add(this.textBox);
			this.Name = "ExceptionForm";
			this.Text = "Application Closed Because of following exception, please report a bug";
			this.ResumeLayout(false);

		}
		#endregion

		private void clipBoardButton_Click(object sender, System.EventArgs e)
		{
			Clipboard.SetDataObject(this.textBox.Text,true);
		}

	}
}
